#include("common.html")
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>结算</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="#(tpath)/static/css/element.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/basic.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/css/filter.css">
    <link rel="stylesheet" type="text/css" href="#(tpath)/static/cityPicker/index.css">
    <script src="#(tpath)/static/js/jquery.js"></script>
    <script src="#(tpath)/static/js/common.js"></script>
    <script src="#(tpath)/static/cityPicker/citydata.min.js"></script>
    <script src="#(tpath)/static/cityPicker/cityPicker-2.0.4.js"></script>
  </head>
  
  <body class="" style="">
  #include("header.html")
    <style type="text/css">#ordersub{ background: #f6f6f6; } .order_warp { background: #fff; /* padding: 10px 20px 50px 0px; */ } .order_warp .step { width: 100%; position: relative; margin-bottom: 10px; } .order_warp .step1 { width: 50%; position: relative; margin-bottom: 10px; float:left; } .order_warp .stephead { width: 100%; height: 40px; line-height:40px; position: relative; border-bottom: 1px solid #f5f5f5; } .order_warp .stephead h1 { font-size:15px; color: #333333; font-weight:bold; width:60%; float:left; } .order_warp .stephead a{float:right;font-size:14px;margin-right:10%;} .order_warp .stepbody { padding-top: 10px; /* padding: 10px 0px; */ } .order_warp .stepbody .address { width: 100%; margin: 0; border-collapse: collapse; } .order_warp #adrslist_box ul li.selected { width: 260px; height: 105px; /*background: url(/static/pc/imgs/abc1.png) right bottom no-repeat #fffbee;*/ margin: 5px 10px 15px 0px; color: #666; border: 1px solid #f15151; float: left; } .order_warp #adrslist_box ul li { cursor: pointer; margin-bottom: 13px; position: relative; } .order_warp #adrslist_box ul li .address_select { width: 237px; height: 90px; font-size: 12px; line-height: 30px; margin: 3px 10px; position: relative; } input { width: 180px; } .order_warp #adrslist_box ul li.unselected { width: 260px; height: 105px; float: left; margin: 5px 10px 15px 0px; color: #666; border: 1px solid #dfdfdf; background: #fff; } .order_warp #adrslist_box ul li .address_unselect { width: 239px; height: 90px; font-size: 12px; line-height: 29px; margin: 3px 10px; position: relative; } .order_warp #adrslist_box ul li .line123 { height: 1px; background: #eee; } .order_warp #adrslist_box ul li input { display: none; } .order_warp .address .col-do a { margin: 0 0px; color: #1b93ef; position: absolute; right: 1px; bottom: -11px; } .order_warp .btn-s1 { color: #fff; padding: 10px 15px; background: #002A6C; display: block; text-align: center; float: left; min-width:96px; border-radius: 2px; font-size: 12px; } .order_warp .btn-s2 { color: #333; padding: 10px 15px; background: #f5f5f5; display: block; text-align: center; float: left; min-width:96px; border-radius: 2px; font-size: 12px; } .layui-btn, .layui-inline, img { vertical-align: middle; } .order_warp .checkout-option-list li.active { border: 1px solid #f15151; } .order_warp .checkout-option-list li { float: left; min-width: 160px; border: 1px solid #dddddd; margin-right: 10px; background: #fff; cursor: pointer; white-space: nowrap; text-align: center; font-size: 12px; color:#666666; margin-bottom: 10px; position: relative; height:48px; line-height:48px; padding:0 25px; } .order_warp .checkout-option-list li img { width: 20px; height: 20px; border-radius:20px; margin-right: 10px; } .order_warp .checkout-option-list li input { display: none; } input { width: 180px; } input, select { vertical-align: middle; } .order_warp .checkout-option-list li input { display: none; } .cart-main { background: #fff; font-size: 12px; } .cart-main .cart-thead { display: block; height: 32px; line-height: 32px; color:#666666; padding: 5px 0; background: #fff; border: 1px solid #f5f5f5; } .cart-main .cart-thead .t-goods-b1 { width: 51%; padding-left: 1%; } .cart-main .cart-thead .column { float: left; } .cart-main .cart-thead .t-price { width: 12%; text-align: center; } .cart-main .cart-thead .t-quantity { width: 12%; text-align: center; } .cart-main .cart-thead .t-sum { width: 12%; text-align: center; } .item-list { background: #fff; border-left: 1px solid #f5f5f5; border-right: 1px solid #f5f5f5; padding-bottom:10px; } .item-list .item-header { font-size: 12px; color: #999; } /*.cart-tbody .item-item { padding-left: 1%; }*/ .cart-tbody .item-item { position: relative; line-height: 20px; background: #fff; padding: 0 10px 0 10px; color:#999999; } .cart-tbody .item-item .item-form { display: inline-block; display: block; } .cart-tbody .item-item .p-goods-b1 { width: 52%; } .cart-tbody .item-item .cell { float: left; padding: 10px 0 0 0; } .cart-tbody .item-item .goods-item .p-img-s { float: left; width: 30px; height: 30px; border: 1px solid #eee; margin-right: 10px; background: #fff; padding: 0; text-align: center; overflow: hidden; line-height: 30px; } .cart-tbody .item-item .goods-item .p-img-s img { width: 30px; height: 30px; float: left; } .cart-tbody .item-item .goods-item .p-name { line-height: 32px; overflow: hidden; } .cart-tbody .item-item .goods-item .p-name a { color: #999999; } .cart-toolbar { height: 50px; border: 1px solid #f0f0f0; background: #fff; position: relative; margin-top: 15px; } .toolbar-wrap { position: relative; margin: 0 auto; } .toolbar-wrap .selected-item-list { position: absolute; z-index: 10; top: -122px; left: 0; height: 122px; } .toolbar-wrap .options-box { position: relative; height: 50px; } .btncart { float: left; height: 18px; line-height: 18px; padding: 16px 0 16px 15px; white-space: nowrap; } .toolbar-wrap .toolbar-right { position: absolute; height: 52px; right: 0; top: -1px; width: 710px; } .toolbar-wrap .toolbar-right .combine .comm-right { float: right; width: 710px; } .toolbar-wrap .price-sum { float: right; height: 43px; line-height: 20px; margin: 7px 20px 0 10px; color: #666; width: auto; } .toolbar-wrap .price-sum div { white-space: nowrap; } .toolbar-wrap .price-sum .price { display: inline-block; text-align: right; font-family: verdana; } .toolbar-wrap .price-sum .price em { font-size: 16px; color: #e58277; font-weight: 700; } .toolbar-wrap .price-sum .txt { float: left; width: 130px; text-align: right; color: #999; } .toolbar-wrap .price-sum .price { display: inline-block; text-align: right; font-family: verdana; } .toolbar-wrap .amount-sum { float: right; color: #999; height: 44px; line-height: 20px; margin: 7px 0 0; cursor: pointer; } .toolbar-wrap .amount-sum em { color: #e58277; font-family: verdana; font-weight: 700; margin: 0 3px; } .toolbar-wrap .amount-sum b.up { background-position: -45px -91px; } .toolbar-wrap .amount-sum b { display: inline-block; width: 9px; height: 5px; background: url(/static/pc/imgs/cart-icons-new.png) -45px -91px; overflow: hidden; vertical-align: middle; margin: -5px 0 0 5px; -webkit-transition: all .2s ease-in 0s; -moz-transition: all .2s ease-in 0s; transition: all .2s ease-in 0s; } .cart-tbody .item-item .p-price { width: 12%; line-height: 32px; } .cart-tbody .item-item .p-price { font-family: verdana; text-align: center; } .cart-tbody .item-item .p-quantity { width: 12%; text-align: center; line-height: 32px; } .cart-tbody .item-item .p-weight { width: 12%; text-align: center; line-height: 32px; } .cart-tbody .item-item .p-sum { width: 12%; text-align: center; line-height: 32px; } .cart-tbody .item-item .p-sum strong { color: #999999; font-weight: 700; } hr { height: 1px; margin: 10px 0; border: 0; background-color: #e2e2e2; clear: both; } .order_warp .order_check .order_r { max-width: 265px; float: right; } .order_warp .order_r dl dt { width: 101px; float: left; text-align: left; color: #333; font-size:12px; padding-top:10px;
      } .order_warp .order_r dl dd { width: 160px; float: left; text-align: right; color: #666666; font-size:12px; padding-top:10px; } .el-input__inner{border:1px solid #f5f5f5;border-radius:0;font-size:12px;} .el-input-group__append, .el-input-group__prepend{font-size:12px;background:#666666;color:#ffffff;border-radius:0;border: 0px;} .order_warp .order_l2 .line2 .dt { float: left; width: 100px; text-align: left; height: 40px; line-height: 40px; margin-top:10px; color:#666666; } .order_warp .order_l2{ width:800px; float: left; margin-top:10px; } .order_warp .order_l2 .line2 .dd { float: left; margin-top:10px; line-height:40px; color:#666666; } .form-control { min-width: 60px; } .form-control { display: block; min-width: 260px; height: 30px; padding: 1px 10px; font-size: 14px; line-height: 30px; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 0px; float: left; } .order_warp .submit_order { clear: both; padding: 25px 0px; } .el-button--danger{width:261px;height:40px;border-radius:0;background:#f15151;} .order_warp .submit_order .btn-submit-order { display: inline-block; } .order_warp .submit_order .btn-submit-order { display: block; width: 200px; text-align: center; font: 16px/44px "Microsoft Yahei"; color: #fff; background-color: #e58277; cursor: pointer; border: none; padding: 0px; } .submit_hint{ margin-right: 20px; background-color: #FFFC40; color: #ed6a0c; float: left; padding: 5px 15px; box-sizing: border-box; width: 90%; } .btn_b { margin: 10px 0 10px; padding: 8px 30px; font-size: 14px; border: none; background: #ee3333; color: #fff !important; cursor: pointer; text-align: center; border-radius: 2px; } .layui-layer-shade { top: 0; left: 0; width: 100%; height: 100%; } .layui-layer-rim { border: 6px solid #8D8D8D; border: 6px solid rgba(0,0,0,.3); border-radius: 5px; box-shadow: none; } .layer-anim { -webkit-animation-name: bounceIn; animation-name: bounceIn; } .layui-layer { border-radius: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-duration: .3s; animation-duration: .3s; } .layui-layer { -webkit-overflow-scrolling: touch; top: 150px; left: 0; margin: 0; padding: 0; background-color: #fff; -webkit-background-clip: content; box-shadow: 1px 1px 50px rgba(0,0,0,.3); } .layui-layer, .layui-layer-shade { position: fixed; _position: absolute; pointer-events: auto; } .layui-layer-title { padding: 0 80px 0 20px; height: 42px; line-height: 42px; border-bottom: 1px solid #eee; font-size: 14px; color: #333; overflow: hidden; background-color: #F8F8F8; border-radius: 2px 2px 0 0; } .layui-layer-imgbar, .layui-layer-imgtit a, .layui-layer-tab .layui-layer-title span, .layui-layer-title { text-overflow: ellipsis; white-space: nowrap; } .layui-layer-page .layui-layer-content { position: relative; overflow: auto; } .layui-layer-page{ z-index: 2000; width: 560px; height: 540px; top: 208.5px; left: 669px; } .notice{ margin-left: 40px; width: 80%; background: #f2f2f2; padding: 10px; box-sizing: border-box; margin-top: 10px; border-radius: 5px; color: #999; font-size:12px; } .layui-form-item { margin-bottom: 15px; clear: both; *zoom: 1; } .layui-form-label { width: 120px; float: left; display: block; padding: 9px 15px; font-weight: 400; text-align: right; } .layui-form-label, .layui-form-mid, .layui-textarea { line-height: 20px; position: relative; } .layui-input-block { margin-left: 150px; } .layui-input-block { margin-left: 110px; min-height: 36px; } .form-control { min-width: 60px; } .form-control { display: block; min-width: 260px; height: 30px; padding: 1px 10px; font-size: 14px; line-height: 30px; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 0px; float: left; } .layui-form-item:after { content: '\20'; clear: both; *zoom: 1; display: block; height: 0; } option { font-weight: normal; display: block; white-space: pre; min-height: 1.2em; padding: 0px 2px 1px; } select.form-control { height: 34px; } .form-control { min-width: 60px; } .area3_list { float: left; width: auto; margin-right: 5px; } .form-control { display: block; min-width: 86px; height: 30px; padding: 1px 10px; font-size: 14px; line-height: 30px; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 0px; float: left; } input, select { vertical-align: middle; } button, input, optgroup, option, select, textarea { font-family: inherit; font-size: inherit; font-style: inherit; font-weight: inherit; outline: 0; } .layui-btn-normal { background-color: #1E9FFF; } .layui-btn { display: inline-block; height: 38px; line-height: 38px; padding: 0 18px; background-color: #009688; color: #fff; white-space: nowrap; text-align: center; border: none; border-radius: 2px; cursor: pointer; opacity: .9; filter: alpha(opacity=90); } .layui-btn-normal { background-color: #1E9FFF; } .layui-btn { display: inline-block; height: 38px; line-height: 38px; padding: 0 18px; background-color: #009688; color: #fff; white-space: nowrap; text-align: center; border: none; border-radius: 2px; cursor: pointer; opacity: .9; filter: alpha(opacity=90); } .input_name{ width: 80%; } .coupon ul li.selected{ width: 300px; height: 100px; /*background: url(/static/pc/imgs/abc1.png) right bottom no-repeat #fffbee;*/ margin: 5px 35px 15px 0px; color: #666; border: 2px solid #f15151; float: left; } .coupon ul li.unselected{ width: 300px; height: 100px; float: left; margin: 5px 35px 15px 0px; color: #666; border: 1px solid #dfdfdf; background: #fff; } .coupon ul li{ cursor: pointer; position: relative; } .coupon_price{ color: #f44; font-size: 24px; font-weight: 500; text-align: center; margin-top: 30px; } .coupon_condition{ font-size: 12px; } .coupon_title{ margin-top: 20px; font-size: 14px; font-weight: 600; -webkit-line-clamp: 2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; } .coupon_time{ margin-top: 5px; font-size: 12px; color:#999999; } .delivery_bt{ position: absolute; right: 5px; top: 12px; background:#002A6C; color:#fff; border-radius:0; border:none; } .el-checkbox{ width: 100%; padding: 10px 0px; } .el-checkbox__input{ float: right; } .el-checkbox__inner{ width: 18px; height: 18px; } .el-checkbox__label{ padding-left: 0px; font-size: 16px; } /*.el-checkbox-group{ border-bottom: 1px solid #dfdfdf; }*/ .dialog_pkg{ width: 100%; } .dialog_pkg-color1{ width: 100%; border-left:10px solid #199ED8; margin-top:10px; background:#ffffff; } .dialog_pkg-color2{ width: 100%; border-left:10px solid #FF3366; margin-top:10px; background:#ffffff; } .dialog_pkg-color3{ width: 100%; border-left:10px solid #3366FF; margin-top:10px; background:#ffffff; } .pkg_content{ display: flex; width: 96%; font-size: 14px; padding:2%; border-bottom: 1px solid #f2f2f4; } .pkg_num{ flex: 1; text-align: right; color: #f44; } .products_content{ display: flex; width: 96%; font-size: 12px; padding:2%; border-bottom: 1px solid #f2f2f4; } .dialog_pkg::-webkit-scrollbar
      { display: none; } .dialog_pkg { -ms-overflow-style: none; overflow: -moz-scrollbars-none; } .account-surplus{ padding: 10px; font-size: 14px; } .account-content{ padding: 0px 10px; font-size: 14px; } .account-content .el-input-group{ width: 30%; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; } input[type="number"] { -moz-appearance: textfield; } .dialog_pkg_content{ width: 100%; height: 500px; white-space: nowrap; overflow-y: scroll; box-sizing: border-box; } .dialog_pkg_content::-webkit-scrollbar { display: none; } .pkg_dialog .el-dialog__header{ padding: 20px 15px 0px; text-align: left; background:#fafafa; } .pkg_dialog .el-dialog__title{ font-size: 22px; } .pkg_dialog .el-dialog__body{ padding: 10px 15px; font-size: 12px; background:#fafafa; } .pkg_dialog .el-checkbox__label{ font-size: 12px; color:#999999; } .pkg_service{ padding: 0px 20px 0 10px; box-sizing: border-box; border-bottom: 1px solid #eee; } .addr_search{ width: 58%; float: left; margin-right: 2%; } .el-dialog__body .el-button{ border: 0px; width:17%; padding:0; text-align:center; line-height:40px; height:40px; border-radius:0; background:#002a6c; color:#ffffff;} .search_dialog{ width: 100%; padding: 5px 15px; box-sizing: border-box; height: 520px; /* overflow-y: scroll; */ } .search_dialog::-webkit-scrollbar { width: 4px; /*height: 4px;*/ } .search_dialog::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); background: rgba(0,0,0,0.2); } .search_dialog::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); border-radius: 0; background: rgba(0,0,0,0.1); } .unselect_img{ width: 18px; height: 18px; margin-top: 10px; } .selected_img{ width: 15px; height: 15px; margin-top: 10px; } .search_item{ padding: 14px 0px; box-sizing: border-box; width: 100%; display: flex; border-bottom: 1px solid #eee; } .search_item_right{ flex: 1; margin-left: 10px; -webkit-line-clamp: 1; /* overflow: hidden; */ text-overflow: ellipsis; /* display: -webkit-box; */ -webkit-box-orient: vertical; } .el-dialog__body{ padding: 15px 20px 70px; } .message_hint{ width: 100%; height: 40px; background-color: #f44; text-align: center; font-size: 14px; line-height: 40px; color: #fff; } .goods-totalprice{border:1px solid #f5f5f5;height:35px;line-height:35px;padding:0 10px;} .goods-totalprice .totalprice-left{width:88%;float:left;color:#333;} .goods-totalprice .totalprice-right{width:12%;float:left;text-align:center;font-weight:bold;color:#666666;} .upload-front{position:absolute;top:0;left:0;width:50%;height:110px;opacity:0;} .upload-back{position:absolute;top:0;left:50%;width:50%;height:110px;opacity:0;} .addr-bt{ position: absolute; bottom: 20px; right: 20px; width: 200px; } .addr-more{ padding: 0px 5px; height: 107px; text-align: center; background-color: #f5f5f5; color: #333; font-size: 12px; float: left; box-sizing: border-box; line-height: 107px; margin-top: 5px; margin-bottom: 15px; } .select_label{ float: left; width: 115px; }</style>
    <div id="ordersub">
      <div class="order_warp">
      	<form id="orderForm">
      	<input type="hidden" name="receiverId" id="receiverId" value="#if(receiver??)#(receiver.id)#end"/>
      	#if(orderType=="CART_BUY")
          #else
      	<input type="hidden" name="productId" value="#(productId)"/>
      	<input type="hidden" name="quantity" value="#(quantity)"/>
      	#end
      	<input type="hidden" name="orderType" value="#(orderType)"/>
        <!---->
        <div class="allwarp">
          <br>
          <div class="step1">
            <div class="stephead">
              <h1>收货地址</h1>
              <a id="chooseReceiver">选择收货地址</a>
              <div class="cl"></div>
            </div>
            <div id="adrslist_box" class="stepbody">

              <div class="address" #if(receiver??) #else style="display: none;"  #end id="addressDiv">
                <ul class="address_list">
                  <li class="selected">
                    <div class="address_select">
                      <input type="radio" name="addr_id" checked="checked">
                      <span class="fr" id="receiverPhone">#if(receiver??) #(receiver.phone) #end</span>
                      <b id="receiverConsignee">#if(receiver??) #(receiver.consignee) #end</b>
                      <div class="line123" id="receiverAddress">#if(receiver??) #(receiver.province)#(receiver.city)#(receiver.district)#(receiver.address) #end</div></div>
                    <div class="cl"></div>
                  </li>
                  <!---->
                  <div class="cl"></div>
                </ul>
              </div>

              <a class="btn-s2 invoice_btn" id="addAddress">+ 新增收货地址</a>
              <div class="cl"></div>
            </div>
          </div>
          <div class="cl"></div>
          <!-- <div class="step">
            <div class="stephead">
              <h1>支付方式</h1></div>
            <div class="stepbody">
              <ul id="payment" class="checkout-option-list">
                <li class="active">
                 微信支付</li>
                <li class="">
                 支付宝支付</li>
                <div class="cl"></div>
              </ul>
            </div>
          </div> -->
          <!---->
          <div class="cart-main" style="padding-bottom: 0px; padding-top: 0px;">
            <div class="cart-thead">
              <div class="column t-goods-b1">商品
              <a style="margin-left: 20px;" href="#(base)/cart/list">(修改购物车)</a></div>
              <div class="column t-price">单价(￥)</div>
              <div class="column t-quantity">数量</div>
              <div class="column t-sum">小计(￥)</div></div>
            <div id="cart-list">
              <div class="cart-item-list">
                <div class="cart-tbody">
                  <div class="item-list" style="z-index: auto;">
                    <div class="item-header">
                      <div class="cl"></div>
                    </div>
                    #if(orderType=="CART_BUY")	
                    #for(cartItem : currentCart.selectCartItems)
          			<!-- list start -->
                    <div class="item-single item-item" style="z-index: auto;">
                      <div class="item-form">
                        <div class="cell p-goods-b1">
                          <div class="goods-item">
                            <div class="p-img-s">
                              <a>
                                <img src="#(imageUrl(cartItem.product.image))"></a>
                            </div>
                            <div class="item-msg">
                              <div class="p-name">
                                <a>#(cartItem.product.name)
                                  <!----></a></div>
                            </div>
                          </div>
                        </div>
                        <div class="cell p-price">#(cartItem.price)</div>
                        <div class="cell p-quantity">#(cartItem.quantity)</div>
                        <div class="cell p-sum">
                          <strong class="ic_subtotal">#(cartItem.subtotal)</strong></div>
                      </div>
                      <div class="cl"></div>
                    </div>
                     #end
                    #else
          			<div class="item-single item-item" style="z-index: auto;">
                      <div class="item-form">
                        <div class="cell p-goods-b1">
                          <div class="goods-item">
                            <div class="p-img-s">
                              <a>
                                <img src="#(imageUrl(product.image))"></a>
                            </div>
                            <div class="item-msg">
                              <div class="p-name">
                                <a>#(product.name)
                                  <!----></a></div>
                            </div>
                          </div>
                        </div>
                        <div class="cell p-price">￥#(product.realPrice)</div>
                        <div class="cell p-quantity">#(quantity)</div>
                        <div class="cell p-weight">
                          <span class="ic_weight">#(product.weight)</span></div>
                        <div class="cell p-sum">
                          <strong class="ic_subtotal">￥#(productPrice)</strong></div>
                      </div>
                      <div class="cl"></div>
                    </div>
                     #end
                    <!-- list end -->
                    
                  </div>
                </div>
              </div>
              <div class="goods-totalprice">
                <div class="totalprice-left">总计</div>
                <div class="totalprice-right">#(orderPrice)</div>
                <div class="cl"></div>
              </div>
            </div>
            <div class="cl"></div>
            <div class="stepbody order_check">
              <div class="stephead">
                <h1>结算明细</h1></div>
              <div id="morder_checkout" class="order_r">
                <!---->
                <dl>
                  <dt>运费：</dt>
                  <dd>
                    <span class="shipcost">￥#(freightPrice)</span></dd>
                </dl>
                <dl>
                  <dt>订单总金额：</dt>
                  <dd>
                    <span id="points">￥#(orderPrice)</span></dd>
                </dl>
                <dl>
                  <dt>商品优惠：</dt>
                  <dd>
                    <span class="shipcost">￥#if(coupon??) #(coupon.price) #else 0.00 #end</span></dd>
                </dl>
                <dl>
                  <dt>应付总额：</dt>
                  <dd>
                    <span class="shipcost" style="color: rgb(241, 81, 81); font-weight: bold;">￥#(orderPrice)</span></dd>
                </dl>
              </div>
              <div class="order_l2">
                <div class="line2">
                  <!---->
                  <div class="cl"></div>
                  <div class="dt">订单留言：</div>
                  <div class="dd" style="width: 500px;">
                    <div class="el-input">
                      <!---->
                      <input type="text" autocomplete="off" placeholder="请输入内容" class="el-input__inner" id="inputMemo" name="memo">
                      <!----></div>
                  </div>
                  <div class="cl"></div>
                </div>
              </div>
            </div>
            <div class="submit_order">
              <button type="button" class="el-button fr el-button--danger el-button--small" id="payBtn" #if(orderPrice<=0) disabled="disabled"  #end>
                <!---->
                <!---->
                <span>提交订单</span></button>
              <div class="cl"></div>
            </div>
          </div>
        </div>
        <div class="el-dialog__wrapper" style="z-index: 2023; display: none;" id="receiverAddDiv">
          
        </div>
        <div class="el-dialog__wrapper" style="z-index: 2019; display: none;" id="receiverListDiv">
          
        </div>
        <div class="el-loading-mask is-fullscreen" style="display: none;background-color: rgba(0, 0, 0, 0.7); z-index: 2002;" id="showloading">
		  <div class="el-loading-spinner">
		    <svg viewBox="25 25 50 50" class="circular">
		      <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
		    </svg>
		    <p class="el-loading-text">加载中……</p></div>
		</div>
        
        <div class="v-modal" tabindex="0" id="dialogModal" style="display: none;z-index: 2004;"></div>
        </form>
      </div>
    </div>
    #include("footer.html")
  </body>

</html>
<script type="text/javascript">

//页面返回 强刷
//页面可见性改变事件
window.addEventListener( "pageshow", function ( event ) {
  var historyTraversal = event.persisted || 
                         ( typeof window.performance != "undefined" && 
                              window.performance.navigation.type === 2 );
  if ( historyTraversal ) {
    // Handle page restore.
    window.location.reload();
  }
});

$("#payBtn").on("click",function(){
	var paymentMethod = $("#payCheck").find(".van-icon-checked").attr("val");
	var receiverId = $("#receiverId").val();
	if(isEmpty(receiverId)){
		alert("收件人地址不能为空!");
		return;
	}
	$("#showloading").show();
	$.ajax({
        url: "#(base)/order/save",
        type: "post",
        data: $("#orderForm").serialize(),
        dataType: "json",
        success: function(res){
        	$("#showloading").hide();
        	if(res.type=="success"){
        		location.href="#(base)/order/payment?orderId="+res.data.orderId;
        	}else{
        		alert(res.msg);
        	}
        },
        error: function(res){
        	$("#showloading").hide();
        }
    });
});
</script>
<script type="text/javascript">

function loadReceiverList(){
	$.ajax({
        url: "#(base)/receiver/list",
        type: "post",
        data: {
       	},
        dataType: "text",
        success: function(res){
        	$("#receiverListDiv").html(res);
        	$("#receiverListDiv").show();
        	$("#dialogModal").show();
        },
        error: function(res){
        }
    });
}

$("#chooseReceiver").on("click",function(){
	loadReceiverList();
});

$("#addAddress").on("click",function(){
	$.ajax({
        url: "#(base)/receiver/add",
        type: "post",
        data: {
       	},
        dataType: "text",
        success: function(res){
        	$("#receiverAddDiv").html(res);
        	$("#receiverAddDiv").show();
        	$("#dialogModal").show();
        },
        error: function(res){
        }
    });
	
});


$("#receiverAddDiv").on("click","#receiverDivClose",function(){
	$("#receiverAddDiv").hide();
	$("#dialogModal").hide();
});


$("#receiverListDiv").on("click","#chooseReceiverClose",function(){
	$("#receiverListDiv").hide();
	$("#dialogModal").hide();
});

$("#receiverListDiv").on("click",".selectAddress",function(){
	var consignee = $(this).attr("consignee");
	var phone = $(this).attr("phone");
	var province = $(this).attr("province");
	var city = $(this).attr("city");
	var district = $(this).attr("district");
	var address = $(this).attr("address");
	var receiverId = $(this).attr("receiverId");
	$("#receiverId").val(receiverId);
	$("#receiverConsignee").html(consignee);
	$("#receiverPhone").html(phone);
	$("#receiverAddress").html(province+city+district+address);
	$("#receiverListDiv").hide();
	$("#dialogModal").hide();
});

$("#receiverAddDiv").on("click","#receiverBtn",function(){
	var consignee = $("#consignee").val();
	if(isEmpty(consignee)){
		alert("请输入收货人姓名");
		return;
	}
	
	var phone = $("#phone").val();
	if(isEmpty(phone)){
		alert("请输入收货人手机号码");
		return;
	}
	var phoneReg = /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/;
	if (!phoneReg.test(phone)) {
		alert("请输入正确的手机号码");
		return;
	}
	
	var isDefault = false;
	if($("#receiverDefault").hasClass("is-checked")){
		isDefault = true;
	}
	
	var area = $("#addressPicker").val();
	if(area==""){
		alert("请选择所在地区");
		return;
	}
	var province = area.split(",")[0];
	var city = area.split(",")[1];
	var district = area.split(",")[2];
	var address = $("#address").val();
	
	$.ajax({
        url: "#(base)/receiver/save",
        type: "post",
        data: {
        	"consignee":consignee,
        	"phone":phone,
        	"province":province,
        	"city":city,
        	"district":district,
        	"address":address,
        	"isDefault":isDefault
       	},
        dataType: "json",
        success: function(res){
        	if(res.type=="success"){
        		alert("操作成功!");
        		$("#receiverAddDiv").hide();
        		$("#dialogModal").hide();

        		$("#receiverId").val(res.data.receiverId);
        		$("#receiverConsignee").html(consignee);
        		$("#receiverPhone").html(phone);
        		$("#receiverAddress").html(province+city+district+address);
        		$("#receiverListDiv").hide();
        		$("#dialogModal").hide();

        		$("#addressDiv").show();
       		}
        },
        error: function(res){
        }
    });
});

$("#receiverAddDiv").on("click",".el-switch",function(){
	if($(this).hasClass("is-checked")){
		$(this).removeClass("is-checked");
	}else{
		$(this).addClass("is-checked");
	}
});
</script>